package sv.gob.mh.dgii.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;

@Entity
@Table(name = "ED_TIPO_RESOL", schema = "EDADEPUDOC")
public class EdTipoResol implements java.io.Serializable {

	private static final long serialVersionUID = -5915356297647723643L;
	
	@Id
	@Column(name = "C_TIPO_RESOLUCION", unique = true, nullable = false, length = 2)
	@NotNull
	@NotEmpty
	private String ctipoResolucion;
	
	@Column(name = "D_TIPO_RESOLUCION", nullable = false, length = 50)
	@NotNull
	@NotEmpty
	private String dtipoResolucion;
	
	@Column(name = "S_DATAWINDOW", nullable = false, length = 60)
	@NotNull
	@NotEmpty
	private String sdatawindow;
	
	@Column(name = "C_USUARIO", nullable = false, length = 30)
	@NotNull
	@NotEmpty
	private String cusuario;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_INGRESO", nullable = false, length = 7)
	@NotNull
	private Date fhingreso;
	
	@Column(name = "B_ACTIVA", nullable = false, precision = 1, scale = 0)
	@NotNull
	private Integer bactiva;
	
	@Column(name = "C_MODELO", nullable = false, length = 3)
	@NotNull
	@NotEmpty
	private String cmodelo;
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "edTipoResol")	
	private Set<EdSolicitudCorr> edSolicitudCorrs = new HashSet<EdSolicitudCorr>(
			0);

	public EdTipoResol() {
	}

	public EdTipoResol(String ctipoResolucion, String dtipoResolucion,
			String sdatawindow, String cusuario, Date fhingreso,
			Integer bactiva, String cmodelo) {
		this.ctipoResolucion = ctipoResolucion;
		this.dtipoResolucion = dtipoResolucion;
		this.sdatawindow = sdatawindow;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.bactiva = bactiva;
		this.cmodelo = cmodelo;
	}

	public EdTipoResol(String ctipoResolucion, String dtipoResolucion,
			String sdatawindow, String cusuario, Date fhingreso,
			Integer bactiva, String cmodelo,
			Set<EdSolicitudCorr> edSolicitudCorrs) {
		this.ctipoResolucion = ctipoResolucion;
		this.dtipoResolucion = dtipoResolucion;
		this.sdatawindow = sdatawindow;
		this.cusuario = cusuario;
		this.fhingreso = fhingreso;
		this.bactiva = bactiva;
		this.cmodelo = cmodelo;
		this.edSolicitudCorrs = edSolicitudCorrs;
	}

	
	public String getCtipoResolucion() {
		return this.ctipoResolucion;
	}

	public void setCtipoResolucion(String ctipoResolucion) {
		this.ctipoResolucion = ctipoResolucion;
	}

	
	public String getDtipoResolucion() {
		return this.dtipoResolucion;
	}

	public void setDtipoResolucion(String dtipoResolucion) {
		this.dtipoResolucion = dtipoResolucion;
	}

	
	public String getSdatawindow() {
		return this.sdatawindow;
	}

	public void setSdatawindow(String sdatawindow) {
		this.sdatawindow = sdatawindow;
	}

	
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	
	public Date getFhingreso() {
		return this.fhingreso;
	}

	public void setFhingreso(Date fhingreso) {
		this.fhingreso = fhingreso;
	}

	
	public Integer getBactiva() {
		return this.bactiva;
	}

	public void setBactiva(Integer bactiva) {
		this.bactiva = bactiva;
	}

	
	public String getCmodelo() {
		return this.cmodelo;
	}

	public void setCmodelo(String cmodelo) {
		this.cmodelo = cmodelo;
	}

	
	public Set<EdSolicitudCorr> getEdSolicitudCorrs() {
		return this.edSolicitudCorrs;
	}

	public void setEdSolicitudCorrs(Set<EdSolicitudCorr> edSolicitudCorrs) {
		this.edSolicitudCorrs = edSolicitudCorrs;
	}

}
